﻿using System.Diagnostics.Contracts;
using T4UtilityBelt.UxDesigns.Controls.Renderers.Windows;
using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Specialized.Renderers.WindowsPhone
{
    public class ActionBarRenderer : ControlRenderer<ActionBar, IActionBarRenderer>, IActionBarRenderer
    {
        protected override void OnRenderUiXmlBegin(ActionBar control, CodeWriter writer)
        {
            Contract.Assert(control != null);
            Contract.Assert(writer != null);

            writer.WriteBeginTag("tcl:BindableApplicationBar");
            writer.WriteEnd();
        }

        protected override void OnRenderUiXmlContent(ActionBar control, CodeWriter writer)
        {
            Contract.Assert(control != null);
            Contract.Assert(writer != null);

            control.Controls.RenderUiXml(writer);
        }

        protected override void OnRenderUiXmlEnd(ActionBar control, CodeWriter writer)
        {
            Contract.Assert(control != null);
            Contract.Assert(writer != null);

            writer.WriteEndTag("tcl:BindableApplicationBar");
        }
    }
}